import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        StringBuilder sb = new StringBuilder();
        while (in.hasNext()) { // 注意 while 处理多个 case
            char[] c = in.nextLine().toCharArray();
            int sum = 0;
            int tmp = 1;
            for (int i = 0; i < c.length - 2; i++) {
                if (c[i] != '-') {
                    sum += (c[i] - '0') * tmp;
                    tmp++;
                }
                sb.append(c[i]);
            }
            sum %= 11;
            sb.append("-");
            if (sum == 10) {
                sb.append("X");
                System.out.println('X' == (c[c.length - 1]) ? "Right" : sb.toString());
            } else {
                sb.append(sum);
                System.out.println(sum == (c[c.length - 1] - '0') ? "Right" : sb.toString());
            }
        }
    }
}
